<?php
// Define path to application directory
defined('APPLICATION_PATH') || define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application'));
// Define application environment
defined('APPLICATION_ENV') || define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production'));
//	Définition de la version du framework à utiliser
defined('FRAMEWORK_PATH') || define('FRAMEWORK_PATH', (getenv('FRAMEWORK_PATH') ? getenv('FRAMEWORK_PATH') : null));
//	Définition du chemin vers le Vendor
defined('VENDOR_PATH') || define('VENDOR_PATH', (getenv('VENDOR_PATH') ? getenv('VENDOR_PATH') : null));
if ( is_null(VENDOR_PATH) || is_null(FRAMEWORK_PATH) ) {
	die("Le FRAMEWORK_PATH et le VENDOR_PATH doivent être définis dans le .htaccess");
}

set_include_path(implode(PATH_SEPARATOR, array(
  realpath(APPLICATION_PATH . '/../library'),
  realpath(FRAMEWORK_PATH . DIRECTORY_SEPARATOR . 'library'), 
  realpath(VENDOR_PATH), 
)));

require_once 'Jnd/App.php';

Jnd_App::run(APPLICATION_ENV, APPLICATION_PATH . '/configs/application.ini');
